package com;

import java.io.UnsupportedEncodingException;

public class CharEncode {

	/**
	 * @author dingdahai
	 * @date Nov 18, 2009 1:58:08 PM
	 * @param args
	 */
	public static void main(String[] args) {
		String str = "腘家";
		byte[] bytes = str.getBytes();
		try {
			String str2 = new String(bytes, "GB2312");
			System.out.println(str2);
			char[] chars = new char[100];
			str2.getChars(0, str2.length(), chars, 0);
			System.out.println(chars);
			
			System.out.println(new String(new String(chars).getBytes("GB2312")));
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
	}

}
